-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ASV: add frame ops benchmarks for varying n_rows/n_columns ratios #39848
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ASV: add frame ops benchmarks for varying n_rows/n_columns ratios #39848
Conversation
A run of those benchmarks:
So the floordiv one is quite slow. I could maybe reduce the number of rows with a factor of 10 in that case. |
|
asv_bench/benchmarks/arithmetic.py
Outdated
n_rows, n_cols = shape | ||
|
||
if op is operator.floordiv: | ||
# floordiv is much slower as the other operations -> use less data |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"as" -> "than"
nitpick, otherwise LGTM |
Currently, we have a benchmark for frame/frame ops with a wide dataframe (originating from previous (long) PR / discussion about this, xref #32779)
To get a better idea of the trade-offs for future changes to the ops code (eg ArrayManager related), I think it is useful to have this benchmark for a varying rows/columns ratio (it is mostly this ratio that determines how much overhead we have when performing ops column-wise).
So I changed the benchmark to be parametrized over 4 different ratios, from a long to a wide dataframe, and with each case having the same number of total elements in the dataframe.
The shape in the original benchmark was
(500, 2000)
, which is somewhere in between two new cases of(10_000, 1000)
and(1000, 10_000)
, so that should preserve the original intent of the benchmark (the last case of(1000, 10_000)
even has a lower row/column ratio, so should even be a "worse" case for the column-wise ops perspective).cc @jbrockmendel